const path = require('path');

function resolve(dir) {
	return path.join(__dirname, dir)
}
module.exports = {
	transpileDependencies: ['@dcloudio/uni-ui'],
	productionSourceMap: false, // 生产打包时不输出map文件，增加打包速度
	configureWebpack: config => {
		console.log("df", config, process.env.NODE_ENV)
		if (process.env.NODE_ENV == 'production') {

			config.optimization.minimizer[0].options.terserOptions.compress.warnings = false
			config.optimization.minimizer[0].options.terserOptions.compress.drop_console = true
			config.optimization.minimizer[0].options.terserOptions.compress.drop_debugger = true
			config.optimization.minimizer[0].options.terserOptions.compress.pure_funcs = ['console.log']
		}
	},
	// chainWebpack: (config) => {
	// 	config.module
	// 		.rule("mjs$")
	// 		.test(/.mjs$/)
	// 		.include.add(/node_modules/)
	// 		.end()
	// 		.type("javascript/auto");
	// },
	// css: {

	// 	loaderOptions: {

	// 		less: {
	// 			modifyVars: {
	// 				'hack': `true; @import "${resolve('style/them.less')}";`
	// 			}
	// 		},
	// 	}
	// }

}